package co.kr.hanbitedu.sample;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class LaunchDemo extends Activity {
    /** Called when the activity is first created. */
	private EditText lat;
	private EditText lon;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        Button btn = (Button) findViewById(R.id.map);
        lat = (EditText) findViewById(R.id.lat);
        lon = (EditText) findViewById(R.id.lon);
        
        btn.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				String _lat = lat.getText().toString();
				String _lon = lon.getText().toString();
				Uri uri = Uri.parse("geo:" + _lat + "," + _lon);
				
				startActivity(new Intent(Intent.ACTION_VIEW, uri));
			}
        	
        });
    }
}